package com.example.demo.order.dto.request;

import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data;

import jakarta.validation.constraints.Min;
import jakarta.validation.constraints.NotNull;
import jakarta.validation.constraints.NotBlank;

/**
 * 添加购物车请求参数
 * 用于接收用户添加商品到购物车的请求数据
 * 
 * @author MingChang.Wei
 * @since 2025/9/26
 */
@Data
@Schema(description = "添加购物车请求参数")
public class CartAddRequest {
    
    /**
     * 用户名
     */
    @NotBlank(message = "用户名不能为空")
    @Schema(description = "用户名，用于标识购物车所属用户", example = "admin")
    private String username;
    
    /**
     * 商品ID
     */
    @NotNull(message = "商品ID不能为空")
    @Min(value = 1, message = "商品ID必须大于0")
    @Schema(description = "商品ID，指定要添加到购物车的商品", example = "2001")
    private Long productId;
    
    /**
     * 商品数量
     */
    @NotNull(message = "商品数量不能为空")
    @Min(value = 1, message = "商品数量必须大于0")
    @Schema(description = "商品数量，添加到购物车的商品数量", example = "1")
    private Integer quantity;
}
